const mongoose = require("mongoose");
//创建管理员列表集合的约束对象
const adminSchema = mongoose.Schema({
  adminName: {
    type: String,
    required: true,//是否是必填项
    unique: true//是否是唯一
  },
  password: {
    type: String,
    required: true
  },
  regTime: {
    type: String,
    required: true
  },
  loginTime: {
    type: String,
    require: true,
    default: "----"//默认时间是空,有值我就用,没有就---
  },
  status: {
    type: Number,
    require: true,
    default: 0
  }
})

//根据这个约束对象创建一个管理员列表的集合
const adminModel = mongoose.model("adminList", adminSchema);

module.exports = adminModel;